<template>
    <!--两列布局--> 
  <div class="wrapper tag-item"> 
   <div class="fl left-list"> 

    <div class="job-position"> 
     <div class="job-type reco-job"> 
      <div class="head"> 
       <h4 class="title pull-left">推荐职位</h4> 
       <span class="more pull-right"><a href="#">更多职位推荐&nbsp;&nbsp;<i class="fa fa-angle-right" aria-hidden="true"></i></a></span> 
       <div class="clearfix"></div> 
      </div> 
      <ul class="yui3-g job-list" style="display:block;"> 
       <li class="yui3-u-1-2 job-item" v-for="(item,index) in recommendList"  :key="index"> 
         <p>
           <span class="name">
             <router-link :to="'/recruit/item/'+item.id">{{item.jobname}}</router-link>
            </span>
        

         <span class="city"><i class="fa fa-map-marker"></i> {{item.address}}</span></p> <p class="need">
           <span class="money">{{item.salary}}</span>/{{item.condition}}/{{item.education}}/{{item.type}}</p> <p><span class="company">{{item.eid}} &middot; {{item.createtime}}</span></p> 
       </li>  
      </ul> 
     </div> 
     <div class="job-type latest-job"> 
      <div class="head"> 
       <h4 class="title pull-left">最新职位</h4> 
       <span class="more pull-right"><a href="#">更多职位推荐&nbsp;&nbsp;<i class="fa fa-angle-right" aria-hidden="true"></i></a></span> 
       <div class="clearfix"></div> 
      </div> 
      <ul class="yui3-g job-list" style="display:block;"> 
      <li class="yui3-u-1-2 job-item" v-for="(item,index) in newlist"  :key="index"> 
         <p><span class="name"><a href="./recruit-detail.html" target="_blank">{{item.jobname}}</a></span>
         <span class="city"><i class="fa fa-map-marker"></i> {{item.address}}</span></p> <p class="need">
           <span class="money">{{item.salary}}</span>/{{item.condition}}/{{item.education}}/{{item.type}}</p> <p><span class="company">{{item.eid}} &middot; {{item.createtime}}</span></p> 
       </li> 
     </ul> 
     </div> 
    </div> 
   </div> 
   <div class="fl right-tag"> 
    <div class="hot-company"> 
     <p class="mail">提交收录请发邮件至ccccccc@qq.com</p> 
     <div class="company"> 
      <div class="head"> 
       <h4>热门企业</h4> 
      </div> 
      <ul class="yui3-g company" style="display:block;"> 
      <li class="yui3-u-1-3 company-item" v-for="(item,index) in hotlist" :key="index"> 
         <p><img src="~/assets/img/widget-baidu.png" alt="" /></p> <p class="title">{{item.name}}</p> 
         <p class="position"><a :href="item.url" target="_blank">{{item.jobcount}}</a></p> </li>   </ul> 
     </div> 
    </div> 
   </div> 
   <div class="clearfix"></div> 
  </div> 
  
</template>

<script>
import '@/assets/css/page-sj-recruit-index.css'

import enterpriseApi from '@/api/enterprise' 
import recruitApi from '@/api/recruit'
import axios from 'axios'


export default {
    head:{
      title: '招聘'
    },
    asyncData(){
      return axios.all([
        recruitApi.recommend(),  //推荐职位
        recruitApi.newlist(),    //最新职位
        enterpriseApi.hotlist()  //热门企业
      ]).then(
        axios.spread(function(res1, res2, res3){
          return{
             recommendList :res1.data.data,
             newlist:res2.data.data,
             hotlist:res3.data.data
          }
           
        })
      )
    }

}
</script>